#ifndef GOMOKU_H
#define GOMOKU_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QMouseEvent>
#include <QTcpSocket>
#include <QHostAddress>
#include <QHostInfo>
#include <QMessageBox>

#define LEN 15
enum chessColor{
    None=0,
    White,
    Black
};


namespace Ui {
class gomoku;
}

class gomoku : public QWidget
{
    Q_OBJECT

public:
    explicit gomoku(QWidget *parent = nullptr);
    ~gomoku();
    void initData();//初始化函数
    int dat[15][15];
    int num=0;

     void judgeResult(int x,int y);


protected:
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);


private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();
    void ReadInfo();
    void connected();
    void on_pushButton_4_clicked();
    void WriteInfo(int x,int y,int z);

private:
    Ui::gomoku *ui;
        bool isBLACK;
        QTcpSocket *tcpSocket;
      bool isChess=false;

};


#endif // GOMOKU_H
